#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int yusuan;
    int monther_give = 300;
    int save_money = 0; // 保存到妈妈那里的钱
    int over_month = 0; // 超出月份
    int have_money = 0; // 手上有多少钱
    for (int i = 1; i <= 12; i++)
    {
        cin >> yusuan;
        have_money += monther_give;
        if (yusuan > have_money)
        {
            over_month = i;
        } 
        else {
            int diff_money = have_money - yusuan;
            if (diff_money < 100)
            {
                have_money = diff_money;
            }
            else
            {
                int hundredNum = floor(diff_money / 100); // 多出了几个整百
                save_money += hundredNum * 100;
                have_money = diff_money - (hundredNum * 100);
            }
        }
    }
    if (over_month > 0)
    {
        cout << "-" << over_month;
        return 0;
    }
    
    if (save_money > 0)
    {
        have_money += save_money*(1+0.2);
    }
    
    cout << have_money;
    
    return 0;
}